package com.budwk.app.sqfw.controllers.admin.customservice;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.budwk.app.sqfw.services.customservice.SqfwBaseDataSearchForAdminService;
import com.budwk.app.sqfw.vo.SqfwCustomForAdminCommonVO;
import com.budwk.starter.common.openapi.annotation.*;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.log.annotation.SLog;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

/**
 * @program: dfxy-community-dev
 * @description: 社区服务基础数据（后台管理系统）
 * @author: LJT
 * @create: 2024-02-29 14:39
 **/
@IocBean
@At("/platform/sqfw/BaseDataSearch")
@ApiDefinition(tag = "社区服务基础数据（后台管理系统）")
@Slf4j
public class SqfwBaseDataSearchForAdminController {

    @Inject
    private SqfwBaseDataSearchForAdminService sqfwBaseDataSearchForAdminService;

    /**
     * 列表查询
     */
    @At
    @Ok("json")
    @POST
    @ApiOperation(name = "基础数据列表查询")
    @ApiFormParams(
            value = {
                    @ApiFormParam(name = "pageNo", example = "1", description = "页码", type = "integer"),
                    @ApiFormParam(name = "pageSize", example = "10", description = "页大小", type = "integer"),
                    @ApiFormParam(name = "pageOrderName", example = "create_date", description = "排序字段"),
                    @ApiFormParam(name = "pageOrderBy", example = "descending", description = "排序方式")
            },
            implementation = SqfwCustomForAdminCommonVO.class
    )
    @ApiResponses(
            implementation = SqfwCustomForAdminCommonVO.class
    )
    @SLog(tag = "基础数据列表查询（后台管理系统）", value = "${args[0]}}")
    @SaCheckLogin
    public Result<?> list(@Param("..") SqfwCustomForAdminCommonVO bean) {
        return Result.data(sqfwBaseDataSearchForAdminService.list(bean));
    }
}
